<extend name="Layout/ins_page" />
<block name="content">
    <link href="/sap/demo.css" rel="stylesheet" type="text/css" />
    <script src="/sap/scripts/boot.js" type="text/javascript"></script>
    <div  id='fm1'>
       <fieldset id="fd1" style="border: 1px solid #e5e5e5;height: 100px">
        <legend><span></span></legend>
        <div id="fm1">
        <div class="fieldset-body" style="margin:0px 5px;">
 <!--          买家姓名： <input id="U_Cstname"  name="U_Cstname" class="mini-textbox" enabled='false' />
          手机号码： <input  id="U_Phone"  name="U_Phone" class="mini-textbox"  value=""enabled='false' /><br/><br/> -->
         <!--订单号： <input type="text" id="orderSn"  name="orderSn" class="mini-textbox" autocomplete="off" placeholder="" />
         手机号：<input type="text" class="mini-textbox" autocomplete="off" placeholder="" id="phone" name="phone">-->  
        发货日期：
		<input id="startTime" class="mini-datepicker" value="{$startTime}" format='yyyy-MM-dd' valueType='string' style='width:8.5%;margin-left:-4px'/>
		<input id="endTime" class="mini-datepicker" value="{$endTime}" format='yyyy-MM-dd' valueType='string' style='width:8.5%' />
        商品编码： <input type="text" id="itemCode"  name="itemCode" class="mini-textbox" autocomplete="off" placeholder="" />
        平台负责人： <input type="text" id="cmanager"  name="cmanager" class="mini-textbox" autocomplete="off" placeholder="" />
        平台名称： <input type="text" id="cardname"  name="cardname" class="mini-textbox" autocomplete="off" placeholder="" />
        产品经理： <input type="text" id="Pmanager"  name="Pmanager" class="mini-textbox" autocomplete="off" placeholder="" />
              <!--<div style="margin-left: -40px" id='statuslist' labelField="true" label="" name="countrys" class="mini-checkboxlist" repeatItems="9" repeatLayout="flow" url="status.txt" value="" textField="text" valueField="id" ></div>-->
           
             <br />
          <br />
           <a class="mini-button" onClick="exportData()"><span class="mini-button-text " >&nbsp;&nbsp;导出&nbsp;&nbsp;</span></a> 
           <a class="mini-button" onClick="search()" style="margin-left:20px;"><span class="mini-button-text ">&nbsp;&nbsp;查询&nbsp;&nbsp;</span></a>
       
          
          
        </div>
        
        
        
          </div>
    </fieldset>
     
        <div class="fieldset-body">

            <div id="tabs1" class="mini-tabs" activeIndex="0" style="width:100%;margin-top: 5px;overflow:auto;" plain="false"
                 buttons="#tabsButtons"
            >
                <div title="列表：" >

                    <div id="datagrid1" class="mini-datagrid" style="height:430px;width: 100%;"
                         url="index.php?m=&c=Omsorder&a=getOrderList" idField="id"
                         allowResize="true"
                         allowCellEdit="true" allowCellSelect="true" multiSelect="true"
                         allowCellValid="true" oncellvalidation=""
                    >

                        <div property="columns">

                            <div field="freetxt"  headerAlign="center"  >订单号
                                <input property="" class="mini-textbox" style="width:100%;" />
                            </div>
                            
                            <div field="u_brand"  headerAlign="center"  >品牌
                                <input property="" class="mini-textbox" style="width:100%;" />
                            </div>
                            
                             <div field="DocDate"  headerAlign="center"  >发货日期
                                <input property="" class="mini-textbox" style="width:100%;" />
                            </div>
                            
                            <div field="ITEMCODE"  headerAlign="center"  >商品编码
                                <input property="" class="mini-textbox" style="width:100%;" />   
                            </div> 
                            <div field="itemname"  headerAlign="center"  >商品名称
                                <input property="" class="mini-textbox" style="width:100%;" />   
                            </div> 
                            
                            
                            <div field="Quantity"  headerAlign="center"  datatype="currency">数量
                                <input property="" class="mini-textbox" style="width:100%;" />
                            </div>
                            
                            <div field="price"  headerAlign="center"  datatype="currency" >单价
                                <input property="" class="mini-textbox" style="width:100%;" />   
                            </div> 
                            <div field="linetotal"  headerAlign="center"  datatype="currency" >总计
                                <input property="" class="mini-textbox" style="width:100%;" />   
                            </div> 
                            
                            
                             <div field="stockprice"  headerAlign="center"  datatype="currency">库存单价
                                <input property="" class="mini-textbox" style="width:100%;" />
                            </div>
                            
                            <div field="LineStockPrice"  headerAlign="center"  datatype="currency">库存价值总计
                                <input property="" class="mini-textbox" style="width:100%;" />   
                            </div> 
                            <div field="CardCode"  headerAlign="center"  >平台代码
                                <input property="" class="mini-textbox" style="width:100%;" />   
                            </div> 
                            
                            
                            <div field="cardname"  headerAlign="center"  >平台名称
                                <input property="" class="mini-textbox" style="width:100%;" />
                            </div>
                            
                            <div field="cmanager"  headerAlign="center"  >平台负责人
                                <input property="" class="mini-textbox" style="width:100%;" />   
                            </div> 
                            <div field="Pmanager"  headerAlign="center"  >产品经理
                                <input property="" class="mini-textbox" style="width:100%;" />   
                            </div> 
                            
                            
                             <div field="calctax"  headerAlign="center" datatype="currency" >税
                                <input property="" class="mini-textbox" style="width:100%;" />
                            </div>
                            
                            <div field="tureexpcost"  headerAlign="center"  datatype="currency" >运费
                                <input property="" class="mini-textbox" style="width:100%;" />   
                            </div> 
                            <div field="bankcharge"  headerAlign="center" datatype="currency" >银行费用
                                <input property="" class="mini-textbox" style="width:100%;" />   
                            </div> 
                            
                            
                            <div field="giftprice"  headerAlign="center"  datatype="currency">赠品成本
                                <input property="" class="mini-textbox" style="width:100%;" />
                            </div>
                            
                            <div field="giftaddexpressfee"  headerAlign="center" datatype="currency" >赠品运费
                                <input property="" class="mini-textbox" style="width:100%;" />   
                            </div> 
                            <div field="addexpressfee"  headerAlign="center"  datatype="currency" >物流附加
                                <input property="" class="mini-textbox" style="width:100%;" />   
                            </div> 
                            
                             <div field="whscode"  headerAlign="center"  >发货仓库
                                <input property="" class="mini-textbox" style="width:100%;" />   
                            </div> 

                        </div>
                    </div>
                </div>
                <!-- <div title="Tab2" iconCls="" >
                    2
                </div> -->
            </div>
        </div>
    </div>


    </body>
    <script type="text/javascript">
        mini.parse();
        var grid = mini.get("datagrid1");
        grid.setPageSize(50);
        grid.load();
        grid.on("drawcell", function (e) {
            var record = e.record,
                column = e.column,
                field = e.field,
                value = e.value;
			   if (field == "DocDate") {
                 e.cellHtml = mini.formatDate(value,"yyyy-MM-dd HH:mm:ss");

                }
				
				
				
			

        });
         function search(){
			 
			 
		
			var startTime = mini.get('startTime').getValue();
			var endTime = mini.get('endTime').getValue();
			var itemCode= mini.get('itemCode').getValue();
			var cmanager= mini.get('cmanager').getValue();
			var cardname= mini.get('cardname').getValue();
			var Pmanager= mini.get('Pmanager').getValue();
	        grid.load({startTime: startTime,endTime:endTime,itemCode:itemCode,cmanager:cmanager,cardname:cardname,Pmanager:Pmanager})     
      	
        }
		
         

        function approve(list_tag,approve) {

            //确认提示
            mini.confirm("确定？", "确定？",
                function (action) {
                    if (action == "ok") {

                        $.ajax({
                            url: "/SapSupplier/doupdatesapitemfromexcel",
                            type: "post",
                            data: {list_tag: list_tag, approve: approve},
                            dataType: 'json',
                            success: function (data) {
                                mini.alert(data.msg);
                            }
                        });


                    } else {

                    }
                }
            );

        }

      function exportData()
	  {
			var startTime = mini.get('startTime').getValue();
			var endTime = mini.get('endTime').getValue();
			var itemCode= mini.get('itemCode').getValue();
			var cmanager= mini.get('cmanager').getValue();
			var cardname= mini.get('cardname').getValue();
			var Pmanager= mini.get('Pmanager').getValue();
	        var url="index.php?m=&c=Omsorder&a=export&startTime="+startTime+"&endTime="+endTime+"&itemCode="+itemCode+"&cmanager="+cmanager+"&cardname="+cardname+"&Pmanager="+Pmanager;
	        location.href=url;
	  }


    </script>
</block>

